package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /*
    * 根据菜品id查询对应的套餐id
    * *///select setmeal_id from setmeal_dish where dish_id in (1,2,3)
    List<Long> getSetMealIdsByDishIds(List<Long> dishIds);

    /*
    * 添加多个菜品信息
    * 算了  先一个一个加  后期会了再改
    * TODO
    * */
    void save(SetmealDish setmealDish);

    /*
    * 删除套餐
    * */
//    @Delete("delete from setmeal_dish where setmeal_id =#{ids}")
    void deleteByIds(List<Long> ids);
    /*
    * 查询setmeal_id的所有信息  形成一个集合
    * */
    @Select("select * from setmeal_dish where setmeal_id=#{setmealId}")
    List<SetmealDish> get(Long setmealId);
}
